home *** CD-ROM | disk | FTP | other *** search
/ ftp.cs.arizona.edu / ftp.cs.arizona.edu.tar / ftp.cs.arizona.edu / icon / newsgrp / group00b.txt / 000104_icon-group-sender_Tue Oct 24 16:48:11 2000.msg < prev    next >
Internet Message Format  |  2001-01-03  |  1KB

  1. Return-Path: <icon-group-sender>
  2. Received: (from root@localhost)
  3.     by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id e9ONm2s25796
  4.     for icon-group-addresses; Tue, 24 Oct 2000 16:48:02 -0700 (MST)
  5. Message-Id: <200010242348.e9ONm2s25796@baskerville.CS.Arizona.EDU>
  6. Date: Tue, 24 Oct 2000 16:21:35 -0500
  7. From: "Charles Hethcoat" <CHETHCOA@oss.oceaneering.com>
  8. To: <icon-group@cs.arizona.edu>
  9. Subject: Re: writing a subset of Prolog
  10. Content-Disposition: inline
  11. X-Guinevere: 1.0.13 ; Oceaneering Int'l
  12. X-MIME-Autoconverted: from quoted-printable to 8bit by baskerville.CS.Arizona.EDU id e9OLOY326145
  13. Errors-To: icon-group-errors@cs.arizona.edu
  14. Status: RO
  15. Content-Length: 649
  16.  
  17. >>> Parvinder Kaur <kaurp@cs.ucdavis.edu> 00-10-24 3:10:54 PM >>> wrote:
  18. > I am writing a subset of Prolog with Icon for a project.  I'm stumped at a particular problem ...
  19.  
  20. In general, the data in a table can be any scalar or structured type:  integer, real, record, list, list of records, etc.  I use tables of lists frequently.  They look somewhat like this:
  21.  
  22. t := table()
  23. t["Ford"] := [1968, "Blue", 142.6]
  24. write(t["Ford"][3])
  25.  
  26. So, t is a table, t["Ford"] is a list, and t["Ford"][3] is a floating point number.
  27.  
  28. This is a very flexible and adaptable approach.  It is my preferred way to build directed graphs, for example.
  29.  
  30. Charles Hethcoat
  31.  
  32.  
  33.